<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RBS::Environment - rbs: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-from_loader">::from_loader</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-3C-3C">#&lt;&lt;</a>
    <li ><a href="#method-i-absolute_type">#absolute_type</a>
    <li ><a href="#method-i-absolute_type_name">#absolute_type_name</a>
    <li ><a href="#method-i-add_signature">#add_signature</a>
    <li ><a href="#method-i-append_context">#append_context</a>
    <li ><a href="#method-i-buffers">#buffers</a>
    <li ><a href="#method-i-class_alias-3F">#class_alias?</a>
    <li ><a href="#method-i-class_decl-3F">#class_decl?</a>
    <li ><a href="#method-i-class_entry">#class_entry</a>
    <li ><a href="#method-i-constant_decl-3F">#constant_decl?</a>
    <li ><a href="#method-i-constant_entry">#constant_entry</a>
    <li ><a href="#method-i-constant_name-3F">#constant_name?</a>
    <li ><a href="#method-i-initialize_copy">#initialize_copy</a>
    <li ><a href="#method-i-insert_decl">#insert_decl</a>
    <li ><a href="#method-i-inspect">#inspect</a>
    <li ><a href="#method-i-interface_name-3F">#interface_name?</a>
    <li ><a href="#method-i-module_alias-3F">#module_alias?</a>
    <li ><a href="#method-i-module_class_entry">#module_class_entry</a>
    <li ><a href="#method-i-module_decl-3F">#module_decl?</a>
    <li ><a href="#method-i-module_entry">#module_entry</a>
    <li ><a href="#method-i-module_name-3F">#module_name?</a>
    <li ><a href="#method-i-normalize_module_name">#normalize_module_name</a>
    <li ><a href="#method-i-normalize_module_name-3F">#normalize_module_name?</a>
    <li ><a href="#method-i-normalize_type_name">#normalize_type_name</a>
    <li ><a href="#method-i-normalize_type_name-21">#normalize_type_name!</a>
    <li ><a href="#method-i-normalize_type_name-3F">#normalize_type_name?</a>
    <li ><a href="#method-i-normalized_class_entry">#normalized_class_entry</a>
    <li ><a href="#method-i-normalized_module_class_entry">#normalized_module_class_entry</a>
    <li ><a href="#method-i-normalized_module_entry">#normalized_module_entry</a>
    <li ><a href="#method-i-normalized_type_name-21">#normalized_type_name!</a>
    <li ><a href="#method-i-normalized_type_name-3F">#normalized_type_name?</a>
    <li ><a href="#method-i-resolve_declaration">#resolve_declaration</a>
    <li ><a href="#method-i-resolve_member">#resolve_member</a>
    <li ><a href="#method-i-resolve_method_type">#resolve_method_type</a>
    <li ><a href="#method-i-resolve_type_names">#resolve_type_names</a>
    <li ><a href="#method-i-resolve_type_params">#resolve_type_params</a>
    <li ><a href="#method-i-resolver_context">#resolver_context</a>
    <li ><a href="#method-i-type_alias_name-3F">#type_alias_name?</a>
    <li ><a href="#method-i-type_name-3F">#type_name?</a>
    <li ><a href="#method-i-unload">#unload</a>
    <li ><a href="#method-i-validate_type_params">#validate_type_params</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RBS::Environment">
    <h1 id="class-RBS::Environment" class="class">
      class RBS::Environment
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-class_alias_decls" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">class_alias_decls</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-class_decls" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">class_decls</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-constant_decls" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">constant_decls</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-declarations" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">declarations</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-global_decls" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">global_decls</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-interface_decls" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">interface_decls</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-signatures" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">signatures</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-type_alias_decls" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">type_alias_decls</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-from_loader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">from_loader</span><span
                                class="method-args">(loader)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="from_loader-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 170</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">from_loader</span>(<span class="ruby-identifier">loader</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">tap</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">env</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">loader</span>.<span class="ruby-identifier">load</span>(<span class="ruby-value">env:</span> <span class="ruby-identifier">env</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 145</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
  <span class="ruby-ivar">@signatures</span> = {}
  <span class="ruby-ivar">@declarations</span> = []

  <span class="ruby-ivar">@class_decls</span> = {}
  <span class="ruby-ivar">@interface_decls</span> = {}
  <span class="ruby-ivar">@type_alias_decls</span> = {}
  <span class="ruby-ivar">@constant_decls</span> = {}
  <span class="ruby-ivar">@global_decls</span> = {}
  <span class="ruby-ivar">@class_alias_decls</span> = {}
  <span class="ruby-ivar">@normalize_module_name_cache</span> = {}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-3C-3C" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">&lt;&lt;</span><span
                                class="method-args">(decl)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="3C-3C-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 470</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">&lt;&lt;</span>(<span class="ruby-identifier">decl</span>)
  <span class="ruby-identifier">declarations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">decl</span>
  <span class="ruby-identifier">insert_decl</span>(<span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> [], <span class="ruby-value">namespace:</span> <span class="ruby-constant">Namespace</span>.<span class="ruby-identifier">root</span>)
  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-absolute_type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">absolute_type</span><span
                                class="method-args">(resolver, map, type, context:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="absolute_type-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 792</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span>)
  <span class="ruby-identifier">type</span>.<span class="ruby-identifier">map_type_name</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">_</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-absolute_type_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">absolute_type_name</span><span
                                class="method-args">(resolver, map, type_name, context:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="absolute_type_name-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 787</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type_name</span>, <span class="ruby-value">context:</span>)
  <span class="ruby-identifier">type_name</span> = <span class="ruby-identifier">map</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">type_name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">type_name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_signature" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_signature</span><span
                                class="method-args">(buffer:, directives:, decls:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_signature-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 476</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_signature</span>(<span class="ruby-value">buffer:</span>, <span class="ruby-value">directives:</span>, <span class="ruby-value">decls:</span>)
  <span class="ruby-identifier">signatures</span>[<span class="ruby-identifier">buffer</span>] = [<span class="ruby-identifier">directives</span>, <span class="ruby-identifier">decls</span>]
  <span class="ruby-identifier">decls</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">decl</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-append_context" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">append_context</span><span
                                class="method-args">(context, decl)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="append_context-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 528</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">append_context</span>(<span class="ruby-identifier">context</span>, <span class="ruby-identifier">decl</span>)
  <span class="ruby-keyword">if</span> (<span class="ruby-identifier">_</span>, <span class="ruby-identifier">last</span> = <span class="ruby-identifier">context</span>)
    <span class="ruby-identifier">last</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">raise</span>
    [<span class="ruby-identifier">context</span>, <span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>]
  <span class="ruby-keyword">else</span>
    [<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">absolute!</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-buffers" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">buffers</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="buffers-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 803</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">buffers</span>
  <span class="ruby-identifier">signatures</span>.<span class="ruby-identifier">keys</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-class_alias-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">class_alias?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="class_alias-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 218</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">class_alias?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">decl</span> = <span class="ruby-identifier">class_alias_decls</span>[<span class="ruby-identifier">name</span>]
    <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassAlias</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-class_decl-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">class_decl?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="class_decl-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 202</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">class_decl?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ClassEntry</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-class_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">class_entry</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="class_entry-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 226</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">class_entry</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">case</span>
  <span class="ruby-keyword">when</span> (<span class="ruby-identifier">class_entry</span> = <span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">type_name</span>]).<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ClassEntry</span>)
    <span class="ruby-identifier">class_entry</span>
  <span class="ruby-keyword">when</span> (<span class="ruby-identifier">class_alias</span> = <span class="ruby-identifier">class_alias_decls</span>[<span class="ruby-identifier">type_name</span>]).<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ClassAliasEntry</span>)
    <span class="ruby-identifier">class_alias</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-constant_decl-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">constant_decl?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="constant_decl-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 198</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">constant_decl?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">constant_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-constant_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">constant_entry</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="constant_entry-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 274</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">constant_entry</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-identifier">class_entry</span>(<span class="ruby-identifier">type_name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">module_entry</span>(<span class="ruby-identifier">type_name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">constant_decls</span>[<span class="ruby-identifier">type_name</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-constant_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">constant_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="constant_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 194</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">constant_name?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">constant_decl?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">module_name?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-initialize_copy" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">initialize_copy</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="initialize_copy-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 158</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize_copy</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-ivar">@signatures</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">signatures</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@declarations</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">declarations</span>.<span class="ruby-identifier">dup</span>

  <span class="ruby-ivar">@class_decls</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">class_decls</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@interface_decls</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">interface_decls</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@type_alias_decls</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">type_alias_decls</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@constant_decls</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">constant_decls</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@global_decls</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">global_decls</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@class_alias_decls</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">class_alias_decls</span>.<span class="ruby-identifier">dup</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-insert_decl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">insert_decl</span><span
                                class="method-args">(decl, outer:, namespace:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="insert_decl-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 373</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_decl</span>(<span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span>, <span class="ruby-value">namespace:</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">decl</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>, <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">namespace</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">cdecl</span> = <span class="ruby-identifier">constant_entry</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">cdecl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ConstantEntry</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">cdecl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ModuleAliasEntry</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">cdecl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ClassAliasEntry</span>)
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-identifier">cdecl</span>.<span class="ruby-identifier">decl</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">class_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">decl</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>
        <span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">ClassEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>
        <span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">ModuleEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">existing_entry</span> = <span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>]

    <span class="ruby-keyword">case</span>
    <span class="ruby-keyword">when</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">existing_entry</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ModuleEntry</span>)
      <span class="ruby-identifier">existing_entry</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">existing_entry</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ClassEntry</span>)
      <span class="ruby-identifier">existing_entry</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-identifier">existing_entry</span>.<span class="ruby-identifier">decls</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">decl</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">prefix</span> = <span class="ruby-identifier">outer</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">decl</span>]
    <span class="ruby-identifier">ns</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_namespace</span>
    <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">each_decl</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">insert_decl</span>(<span class="ruby-identifier">d</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">prefix</span>, <span class="ruby-value">namespace:</span> <span class="ruby-identifier">ns</span>)
    <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Interface</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">namespace</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">interface_entry</span> = <span class="ruby-identifier">interface_decls</span>[<span class="ruby-identifier">name</span>]
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-identifier">interface_entry</span>.<span class="ruby-identifier">decl</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">interface_decls</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-constant">InterfaceEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>, <span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">TypeAlias</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">namespace</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">type_alias_decls</span>[<span class="ruby-identifier">name</span>]
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">decl</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">type_alias_decls</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-constant">TypeAliasEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>, <span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Constant</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">namespace</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">constant_entry</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">entry</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassAliasEntry</span>, <span class="ruby-constant">ModuleAliasEntry</span>, <span class="ruby-constant">ConstantEntry</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">decl</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassEntry</span>, <span class="ruby-constant">ModuleEntry</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">entry</span>.<span class="ruby-identifier">decls</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:decl</span>))
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">constant_decls</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-constant">ConstantEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>, <span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Global</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">global_decls</span>[<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>]
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">decl</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">global_decls</span>[<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-constant">GlobalEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassAlias</span>, <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ModuleAlias</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">new_name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">namespace</span>)

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">constant_entry</span>(<span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">entry</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassAliasEntry</span>, <span class="ruby-constant">ModuleAliasEntry</span>, <span class="ruby-constant">ConstantEntry</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">decl</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassEntry</span>, <span class="ruby-constant">ModuleEntry</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">DuplicatedDeclarationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">entry</span>.<span class="ruby-identifier">decls</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:decl</span>))
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">decl</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassAlias</span>
      <span class="ruby-identifier">class_alias_decls</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-constant">ClassAliasEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>, <span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ModuleAlias</span>
      <span class="ruby-identifier">class_alias_decls</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-constant">ModuleAliasEntry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>, <span class="ruby-value">decl:</span> <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inspect" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inspect</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inspect-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 798</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect</span>
  <span class="ruby-identifier">ivars</span> = <span class="ruby-node">%i[@declarations @class_decls @class_alias_decls @interface_decls @type_alias_decls @constant_decls @global_decls]</span>
  <span class="ruby-node">&quot;\#&lt;RBS::Environment #{ivars.map { |iv| &quot;#{iv}=(#{instance_variable_get(iv).size} items)&quot;}.join(&#39; &#39;)}&gt;&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-interface_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">interface_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="interface_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 176</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">interface_name?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">interface_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-module_alias-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">module_alias?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="module_alias-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 210</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">module_alias?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">decl</span> = <span class="ruby-identifier">class_alias_decls</span>[<span class="ruby-identifier">name</span>]
    <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ModuleAlias</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-module_class_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">module_class_entry</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="module_class_entry-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 266</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">module_class_entry</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-identifier">class_entry</span>(<span class="ruby-identifier">type_name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">module_entry</span>(<span class="ruby-identifier">type_name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-module_decl-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">module_decl?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="module_decl-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 206</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">module_decl?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ModuleEntry</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-module_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">module_entry</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="module_entry-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 235</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">module_entry</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">case</span>
  <span class="ruby-keyword">when</span> (<span class="ruby-identifier">module_entry</span> = <span class="ruby-identifier">class_decls</span>[<span class="ruby-identifier">type_name</span>]).<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ModuleEntry</span>)
    <span class="ruby-identifier">module_entry</span>
  <span class="ruby-keyword">when</span> (<span class="ruby-identifier">module_alias</span> = <span class="ruby-identifier">class_alias_decls</span>[<span class="ruby-identifier">type_name</span>]).<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">ModuleAliasEntry</span>)
    <span class="ruby-identifier">module_alias</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-module_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">module_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="module_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 184</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">module_name?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">class_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">class_alias_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalize_module_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalize_module_name</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalize_module_name-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 332</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalize_module_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">normalize_module_name?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">or</span> <span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalize_module_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalize_module_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalize_module_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 336</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalize_module_name?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Class/module name is expected: #{name}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">class?</span>
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">absolute!</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">absolute?</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@normalize_module_name_cache</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-ivar">@normalize_module_name_cache</span>[<span class="ruby-identifier">name</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">to_type_name</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">normalized_parent</span> = <span class="ruby-identifier">normalize_module_name?</span>(<span class="ruby-identifier">parent</span>)
      <span class="ruby-identifier">type_name</span> = <span class="ruby-constant">TypeName</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">namespace:</span> <span class="ruby-identifier">normalized_parent</span>.<span class="ruby-identifier">to_namespace</span>, <span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@normalize_module_name_cache</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">type_name</span> = <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@normalize_module_name_cache</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-keyword">false</span>

  <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">constant_entry</span>(<span class="ruby-identifier">type_name</span>)

  <span class="ruby-identifier">normalized_type_name</span> =
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">entry</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassEntry</span>, <span class="ruby-constant">ModuleEntry</span>
      <span class="ruby-identifier">type_name</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassAliasEntry</span>, <span class="ruby-constant">ModuleAliasEntry</span>
      <span class="ruby-identifier">normalize_module_name?</span>(<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">decl</span>.<span class="ruby-identifier">old_name</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@normalize_module_name_cache</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">normalized_type_name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalize_type_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalize_type_name</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalize_type_name-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 328</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalize_type_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">normalize_type_name?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalize_type_name-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalize_type_name!</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalize_type_name-21-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 297</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalize_type_name!</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">normalize_type_name?</span>(<span class="ruby-identifier">name</span>)

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">result</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">TypeName</span>
    <span class="ruby-identifier">result</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">false</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Type name `#{name}` cannot be normalized because it&#39;s a cyclic definition&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Type name `#{name}` cannot be normalized because of unknown type name in the path&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalize_type_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalize_type_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalize_type_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 278</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalize_type_name?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">normalize_module_name?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">class?</span>

  <span class="ruby-identifier">type_name</span> =
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">to_type_name</span>
      <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">normalize_module_name?</span>(<span class="ruby-identifier">parent</span>)
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">parent</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">parent</span>

      <span class="ruby-constant">TypeName</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">namespace:</span> <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">to_namespace</span>, <span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">name</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">type_name?</span>(<span class="ruby-identifier">type_name</span>)
    <span class="ruby-identifier">type_name</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalized_class_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalized_class_entry</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalized_class_entry-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 244</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalized_class_entry</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span> = <span class="ruby-identifier">normalize_module_name?</span>(<span class="ruby-identifier">type_name</span>)
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">class_entry</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassEntry</span>, <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">entry</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">ClassAliasEntry</span>
      <span class="ruby-identifier">raise</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalized_module_class_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalized_module_class_entry</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalized_module_class_entry-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 270</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalized_module_class_entry</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-identifier">normalized_class_entry</span>(<span class="ruby-identifier">type_name</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">normalized_module_entry</span>(<span class="ruby-identifier">type_name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalized_module_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalized_module_entry</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalized_module_entry-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 255</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalized_module_entry</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span> = <span class="ruby-identifier">normalize_module_name?</span>(<span class="ruby-identifier">type_name</span>)
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">module_entry</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-constant">ModuleEntry</span>, <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">entry</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">ModuleAliasEntry</span>
      <span class="ruby-identifier">raise</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalized_type_name-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalized_type_name!</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalized_type_name-21-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 323</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalized_type_name!</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">normalized_type_name?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword">or</span> <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Normalized type name is expected but given `#{name}`, which is normalized to `#{normalize_type_name?(name)}`&quot;</span>
  <span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalized_type_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalized_type_name?</span><span
                                class="method-args">(type_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalized_type_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 310</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalized_type_name?</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">case</span>
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">interface?</span>
    <span class="ruby-identifier">interface_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">class?</span>
    <span class="ruby-identifier">class_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">type_name</span>.<span class="ruby-identifier">alias?</span>
    <span class="ruby-identifier">type_alias_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">type_name</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_declaration" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_declaration</span><span
                                class="method-args">(resolver, map, decl, outer:, prefix:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_declaration-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 537</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_declaration</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span>, <span class="ruby-value">prefix:</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Global</span>)
    <span class="ruby-comment"># @type var decl: AST::Declarations::Global</span>
    <span class="ruby-keyword">return</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Global</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-keyword">nil</span>),
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>
    )
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">context</span> = <span class="ruby-identifier">resolver_context</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">outer</span>)

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">decl</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>
    <span class="ruby-identifier">outer_context</span> = <span class="ruby-identifier">context</span>
    <span class="ruby-identifier">inner_context</span> = <span class="ruby-identifier">append_context</span>(<span class="ruby-identifier">outer_context</span>, <span class="ruby-identifier">decl</span>)

    <span class="ruby-identifier">outer_</span> = <span class="ruby-identifier">outer</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">decl</span>]
    <span class="ruby-identifier">prefix_</span> = <span class="ruby-identifier">prefix</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_namespace</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">prefix</span>),
      <span class="ruby-value">type_params:</span> <span class="ruby-identifier">resolve_type_params</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type_params</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">inner_context</span>),
      <span class="ruby-value">super_class:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">super_class</span>&amp;.<span class="ruby-identifier">yield_self</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">super_class</span><span class="ruby-operator">|</span>
        <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Class</span><span class="ruby-operator">::</span><span class="ruby-constant">Super</span>.<span class="ruby-identifier">new</span>(
          <span class="ruby-value">name:</span> <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">super_class</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">outer_context</span>),
          <span class="ruby-value">args:</span> <span class="ruby-identifier">super_class</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">outer_context</span>) },
          <span class="ruby-value">location:</span> <span class="ruby-identifier">super_class</span>.<span class="ruby-identifier">location</span>
        )
      <span class="ruby-keyword">end</span>,
      <span class="ruby-value">members:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">members</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">case</span> <span class="ruby-identifier">member</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
          <span class="ruby-identifier">resolve_member</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">inner_context</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
          <span class="ruby-identifier">resolve_declaration</span>(
            <span class="ruby-identifier">resolver</span>,
            <span class="ruby-identifier">map</span>,
            <span class="ruby-identifier">member</span>,
            <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer_</span>,
            <span class="ruby-value">prefix:</span> <span class="ruby-identifier">prefix_</span>
          )
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">raise</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">annotations</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>
    )

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>
    <span class="ruby-identifier">outer_context</span> = <span class="ruby-identifier">context</span>
    <span class="ruby-identifier">inner_context</span> = <span class="ruby-identifier">append_context</span>(<span class="ruby-identifier">outer_context</span>, <span class="ruby-identifier">decl</span>)

    <span class="ruby-identifier">outer_</span> = <span class="ruby-identifier">outer</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">decl</span>]
    <span class="ruby-identifier">prefix_</span> = <span class="ruby-identifier">prefix</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_namespace</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">prefix</span>),
      <span class="ruby-value">type_params:</span> <span class="ruby-identifier">resolve_type_params</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type_params</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">inner_context</span>),
      <span class="ruby-value">self_types:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">self_types</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">module_self</span><span class="ruby-operator">|</span>
        <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Module</span><span class="ruby-operator">::</span><span class="ruby-constant">Self</span>.<span class="ruby-identifier">new</span>(
          <span class="ruby-value">name:</span> <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">module_self</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">inner_context</span>),
          <span class="ruby-value">args:</span> <span class="ruby-identifier">module_self</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">inner_context</span>) },
          <span class="ruby-value">location:</span> <span class="ruby-identifier">module_self</span>.<span class="ruby-identifier">location</span>
        )
      <span class="ruby-keyword">end</span>,
      <span class="ruby-value">members:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">members</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">case</span> <span class="ruby-identifier">member</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
          <span class="ruby-identifier">resolve_member</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">inner_context</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
          <span class="ruby-identifier">resolve_declaration</span>(
            <span class="ruby-identifier">resolver</span>,
            <span class="ruby-identifier">map</span>,
            <span class="ruby-identifier">member</span>,
            <span class="ruby-value">outer:</span> <span class="ruby-identifier">outer_</span>,
            <span class="ruby-value">prefix:</span> <span class="ruby-identifier">prefix_</span>
          )
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">raise</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">annotations</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>
    )

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Interface</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Interface</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">prefix</span>),
      <span class="ruby-value">type_params:</span> <span class="ruby-identifier">resolve_type_params</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type_params</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">members:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">members</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">member</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">resolve_member</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>)
      <span class="ruby-keyword">end</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">annotations</span>
    )

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">TypeAlias</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">TypeAlias</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">prefix</span>),
      <span class="ruby-value">type_params:</span> <span class="ruby-identifier">resolve_type_params</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type_params</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">annotations</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>
    )

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Constant</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">Constant</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">prefix</span>),
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>
    )

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassAlias</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassAlias</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">new_name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">new_name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">prefix</span>),
      <span class="ruby-value">old_name:</span> <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">old_name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>
    )

  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ModuleAlias</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Declarations</span><span class="ruby-operator">::</span><span class="ruby-constant">ModuleAlias</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">new_name:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">new_name</span>.<span class="ruby-identifier">with_prefix</span>(<span class="ruby-identifier">prefix</span>),
      <span class="ruby-value">old_name:</span> <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">old_name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">location:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">comment</span>
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_member" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_member</span><span
                                class="method-args">(resolver, map, member, context:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_member-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 673</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_member</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>, <span class="ruby-value">context:</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">member</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">MethodDefinition</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">MethodDefinition</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">kind:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">kind</span>,
      <span class="ruby-value">overloads:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">overloads</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">overload</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">overload</span>.<span class="ruby-identifier">update</span>(
          <span class="ruby-value">method_type:</span> <span class="ruby-identifier">resolve_method_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">overload</span>.<span class="ruby-identifier">method_type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>)
        )
      <span class="ruby-keyword">end</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">overloading:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">overloading?</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">annotations</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">visibility:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">visibility</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrAccessor</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">kind:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">kind</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">annotations</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">ivar_name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">ivar_name</span>,
      <span class="ruby-value">visibility:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">visibility</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrReader</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrReader</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">kind:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">kind</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">annotations</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">ivar_name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">ivar_name</span>,
      <span class="ruby-value">visibility:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">visibility</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrWriter</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">AttrWriter</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">kind:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">kind</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">annotations</span>,
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">ivar_name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">ivar_name</span>,
      <span class="ruby-value">visibility:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">visibility</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceVariable</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceVariable</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassInstanceVariable</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassInstanceVariable</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassVariable</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassVariable</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Include</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Include</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">args:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>) },
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">annotations</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Extend</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Extend</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">args:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>) },
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">annotations</span>
    )
  <span class="ruby-keyword">when</span> <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Prepend</span>
    <span class="ruby-constant">AST</span><span class="ruby-operator">::</span><span class="ruby-constant">Members</span><span class="ruby-operator">::</span><span class="ruby-constant">Prepend</span>.<span class="ruby-identifier">new</span>(
      <span class="ruby-value">name:</span> <span class="ruby-identifier">absolute_type_name</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">member</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>),
      <span class="ruby-value">args:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>) },
      <span class="ruby-value">comment:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">comment</span>,
      <span class="ruby-value">location:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">location</span>,
      <span class="ruby-value">annotations:</span> <span class="ruby-identifier">member</span>.<span class="ruby-identifier">annotations</span>
    )
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">member</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_method_type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_method_type</span><span
                                class="method-args">(resolver, map, type, context:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_method_type-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 773</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_method_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span>)
  <span class="ruby-identifier">type</span>.<span class="ruby-identifier">map_type</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ty</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">ty</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>)
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">map_type_bound</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">bound</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">_</span> = <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">bound</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_type_names" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_type_names</span><span
                                class="method-args">(only: nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_type_names-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 489</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_type_names</span>(<span class="ruby-value">only:</span> <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">resolver</span> = <span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">TypeNameResolver</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>)
  <span class="ruby-identifier">env</span> = <span class="ruby-constant">Environment</span>.<span class="ruby-identifier">new</span>

  <span class="ruby-identifier">table</span> = <span class="ruby-constant">UseMap</span><span class="ruby-operator">::</span><span class="ruby-constant">Table</span>.<span class="ruby-identifier">new</span>()
  <span class="ruby-identifier">table</span>.<span class="ruby-identifier">known_types</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">class_decls</span>.<span class="ruby-identifier">keys</span>)
  <span class="ruby-identifier">table</span>.<span class="ruby-identifier">known_types</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">class_alias_decls</span>.<span class="ruby-identifier">keys</span>)
  <span class="ruby-identifier">table</span>.<span class="ruby-identifier">known_types</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">type_alias_decls</span>.<span class="ruby-identifier">keys</span>)
  <span class="ruby-identifier">table</span>.<span class="ruby-identifier">known_types</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">interface_decls</span>.<span class="ruby-identifier">keys</span>)
  <span class="ruby-identifier">table</span>.<span class="ruby-identifier">compute_children</span>

  <span class="ruby-identifier">signatures</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">buffer</span>, (<span class="ruby-identifier">dirs</span>, <span class="ruby-identifier">decls</span>)<span class="ruby-operator">|</span>
    <span class="ruby-identifier">map</span> = <span class="ruby-constant">UseMap</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">table:</span> <span class="ruby-identifier">table</span>)
    <span class="ruby-identifier">dirs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">clauses</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">clause</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">map</span>.<span class="ruby-identifier">build_map</span>(<span class="ruby-identifier">clause</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">decls</span> = <span class="ruby-identifier">decls</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">only</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">only</span>.<span class="ruby-identifier">member?</span>(<span class="ruby-identifier">decl</span>)
        <span class="ruby-identifier">decl</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">resolve_declaration</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">decl</span>, <span class="ruby-value">outer:</span> [], <span class="ruby-value">prefix:</span> <span class="ruby-constant">Namespace</span>.<span class="ruby-identifier">root</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">env</span>.<span class="ruby-identifier">add_signature</span>(<span class="ruby-value">buffer:</span> <span class="ruby-identifier">buffer</span>, <span class="ruby-value">directives:</span> <span class="ruby-identifier">dirs</span>, <span class="ruby-value">decls:</span> <span class="ruby-identifier">decls</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">env</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_type_params" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_type_params</span><span
                                class="method-args">(resolver, map, params, context:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_type_params-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 781</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_type_params</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">params</span>, <span class="ruby-value">context:</span>)
  <span class="ruby-identifier">params</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">param</span>.<span class="ruby-identifier">map_type</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">_</span> = <span class="ruby-identifier">absolute_type</span>(<span class="ruby-identifier">resolver</span>, <span class="ruby-identifier">map</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">context:</span> <span class="ruby-identifier">context</span>) }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolver_context" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolver_context</span><span
                                class="method-args">(*nesting)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolver_context-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 522</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolver_context</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">nesting</span>)
  <span class="ruby-identifier">nesting</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-keyword">nil</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">context</span>, <span class="ruby-identifier">decl</span><span class="ruby-operator">|</span> <span class="ruby-comment">#$ Resolver::context</span>
    <span class="ruby-identifier">append_context</span>(<span class="ruby-identifier">context</span>, <span class="ruby-identifier">decl</span>)
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-type_alias_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">type_alias_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="type_alias_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 180</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">type_alias_name?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">type_alias_decls</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-type_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">type_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="type_name-3F-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 188</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">type_name?</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">interface_name?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">||</span>
    <span class="ruby-identifier">type_alias_name?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">||</span>
    <span class="ruby-identifier">module_name?</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-unload" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">unload</span><span
                                class="method-args">(buffers)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="unload-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 807</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unload</span>(<span class="ruby-identifier">buffers</span>)
  <span class="ruby-identifier">env</span> = <span class="ruby-constant">Environment</span>.<span class="ruby-identifier">new</span>

  <span class="ruby-identifier">signatures</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">buf</span>, (<span class="ruby-identifier">dirs</span>, <span class="ruby-identifier">decls</span>)<span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">buffers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">buf</span>)
    <span class="ruby-identifier">env</span>.<span class="ruby-identifier">add_signature</span>(<span class="ruby-value">buffer:</span> <span class="ruby-identifier">buf</span>, <span class="ruby-value">directives:</span> <span class="ruby-identifier">dirs</span>, <span class="ruby-value">decls:</span> <span class="ruby-identifier">decls</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">env</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_type_params" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_type_params</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate_type_params-source">
            <pre><span class="ruby-comment"># File rbs-3.2.1/lib/rbs/environment.rb, line 483</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_type_params</span>
  <span class="ruby-identifier">class_decls</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">primary</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

